package com.wgts.wgts.dagger.module;

import com.wgts.wgts.dagger.scope.ActivityScope;
import com.wgts.wgts.dagger.scope.FragmentScope;
import com.wgts.wgts.mvp.model.IJDHeaderFragmentModel;
import com.wgts.wgts.mvp.model.imp.JDHeaderFragmentModel;
import com.wgts.wgts.mvp.presenter.IJDHeaderFragmentPersenter;
import com.wgts.wgts.mvp.presenter.imp.JDHeaderFragmentPersenter;
import com.wgts.wgts.mvp.view.IJDHeaderFragmentView;
import com.wgts.wgts.netmodle.NetService;
import com.wgts.wgts.tools.CountDownTime;

import dagger.Module;
import dagger.Provides;

@Module
public class JDHeaderFragmentMoudle {

    private IJDHeaderFragmentView view;

    public JDHeaderFragmentMoudle(IJDHeaderFragmentView view) {
        this.view = view;
    }

    @Provides
    @FragmentScope
    public IJDHeaderFragmentView provideView(){
        return view;
    }

    @Provides
    @FragmentScope
    public IJDHeaderFragmentModel provideModel(NetService netService){
        return new JDHeaderFragmentModel(netService);
    }

    @Provides
    @FragmentScope
    public IJDHeaderFragmentPersenter providePersenter(IJDHeaderFragmentView view, IJDHeaderFragmentModel model, CountDownTime countDownTime){
        return new JDHeaderFragmentPersenter(model, view, countDownTime);
    }
}
